/**
 * C Programming: A Modern Approach
 *
 * version: 2nd
 * author: K.N.King
 * http://knking.com/books/c2
 */

#include <stdio.h>

/**
 *
 */

int main(void) {
    int amount = 0;
    int twenty_num = 0;
    int ten_num = 0;
    int five_num = 0;
    int one_num = 0;

    printf("Enter a dollar amount:");
    scanf("%d", &amount);

    twenty_num = amount / 20;
    ten_num = (amount - 20 * twenty_num) / 10;
    five_num = (amount - 20 * twenty_num - 10 * ten_num) / 5;
    one_num = amount - 20 * twenty_num - 10 * ten_num - 5 * five_num;

    printf("$20 bills: %d\n", twenty_num);
    printf("$10 bills: %d\n", ten_num);
    printf(" $5 bills: %d\n", five_num);
    printf(" $1 bills: %d\n", one_num);

    return 0;
}

/*
output:
Enter a dollar amount:93
$20 bills: 4
$10 bills: 1
 $5 bills: 0
 $1 bills: 3
*/